﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Prsrp
{
    public class BaseParticle : BaseAsset
    {
        public float mfLifeSpan = 0;
        public float mfMaxLifeSpan = 10000;

        public override void Update()
        {
            // Update @mfLifeSpan
            float fDeltaTime = (float)Game.Engine.GameTime.ElapsedGameTime.TotalMilliseconds;
            mfLifeSpan += fDeltaTime;

            // Delete Particle at end the animation or is @mfLifeSpan
            if (mtabStateSprites[0].mbReachEnd || mfLifeSpan > mfMaxLifeSpan)
            {
                Dispose();
            }
        }
    }
}
